// 定时任务日志路由
import { Router } from 'express';
import jobLogController from '@/controllers/monitor/jobLog.controller';
import { authMiddleware } from '@/middlewares/auth.middleware';
import { permissionMiddleware } from '@/middlewares/permission.middleware';

const router = Router();

/**
 * 定时任务日志监控路由
 * 路径前缀：/monitor/jobLog
 */

// ================== 定时任务日志相关 ==================

// 所有路由均需认证
router.use(authMiddleware);

// 查询定时任务日志列表
router.get('/list', permissionMiddleware('monitor:job:query'), jobLogController.list);

// 导出定时任务日志
router.post('/export', permissionMiddleware('monitor:job:export'), jobLogController.export);

// 清空定时任务日志
router.delete('/clean', permissionMiddleware('monitor:job:remove'), jobLogController.clean);

// 删除定时任务日志
router.delete('/:jobLogIds', permissionMiddleware('monitor:job:remove'), jobLogController.remove);

// 获取定时任务日志详细信息
router.get('/:jobLogId', permissionMiddleware('monitor:job:query'), jobLogController.getInfo);

export default router; 